<script setup lang="ts">
// 首页专用骨架屏组件
</script>

<template>
  <div class="animate-pulse bg-gray-50">
    <!-- 页面头部骨架 -->
    <div class="mb-4">
      <div class="mb-4 flex items-center justify-between">
        <div>
          <div class="mb-2 h-6 w-24 rounded bg-gray-200"></div>
          <div class="h-4 w-32 rounded bg-gray-200"></div>
        </div>
        <div class="text-right">
          <div class="mb-1 h-4 w-20 rounded bg-gray-200"></div>
          <div class="h-3 w-16 rounded bg-gray-200"></div>
        </div>
      </div>

      <!-- 统计卡片骨架 -->
      <div class="grid grid-cols-1 mb-4 gap-4 lg:grid-cols-4 md:grid-cols-2">
        <div v-for="i in 4" :key="i" class="rounded-lg bg-white p-4">
          <div class="flex items-center justify-between">
            <div>
              <div class="mb-2 h-4 w-16 rounded bg-gray-200"></div>
              <div class="h-6 w-20 rounded bg-gray-200"></div>
            </div>
            <div class="h-8 w-8 rounded bg-gray-200"></div>
          </div>
        </div>
      </div>
    </div>

    <!-- 主体内容区域骨架 -->
    <div class="grid grid-cols-1 gap-4 lg:grid-cols-4">
      <!-- 左侧主要区域 -->
      <div class="lg:col-span-3 space-y-4">
        <!-- 商品数据卡片骨架 -->
        <div class="rounded-lg bg-white p-4">
          <div class="mb-4 flex items-center">
            <div class="mr-2 h-4 w-4 rounded bg-gray-200"></div>
            <div class="h-4 w-20 rounded bg-gray-200"></div>
          </div>
          <div class="grid grid-cols-2 gap-4 lg:grid-cols-6 md:grid-cols-4">
            <div v-for="i in 6" :key="i" class="text-center">
              <div class="mb-2 h-6 w-full rounded bg-gray-200"></div>
              <div class="h-4 w-full rounded bg-gray-200"></div>
            </div>
          </div>
        </div>

        <!-- 图表区域第一行骨架 -->
        <div class="grid grid-cols-1 gap-4 lg:grid-cols-3">
          <div v-for="i in 3" :key="i" class="rounded-lg bg-white p-4">
            <div class="mb-4 h-4 w-24 rounded bg-gray-200"></div>
            <div class="h-64 rounded bg-gray-200"></div>
          </div>
        </div>

        <!-- 图表区域第二行骨架 -->
        <div class="grid grid-cols-1 gap-4 lg:grid-cols-3">
          <div class="rounded-lg bg-white p-4">
            <div class="mb-4 h-4 w-24 rounded bg-gray-200"></div>
            <div class="h-64 rounded bg-gray-200"></div>
          </div>
          <div class="rounded-lg bg-white p-4 lg:col-span-2">
            <div class="mb-4 h-4 w-24 rounded bg-gray-200"></div>
            <div class="h-64 rounded bg-gray-200"></div>
          </div>
        </div>
      </div>

      <!-- 右侧信息区骨架 -->
      <div class="space-y-4">
        <!-- 待办事项骨架 -->
        <div class="rounded-lg bg-white p-4">
          <div class="mb-4 flex items-center">
            <div class="mr-2 h-4 w-4 rounded bg-gray-200"></div>
            <div class="h-4 w-16 rounded bg-gray-200"></div>
          </div>
          <div class="space-y-3">
            <div v-for="i in 3" :key="i" class="flex items-center justify-between">
              <div class="h-4 w-20 rounded bg-gray-200"></div>
              <div class="h-6 w-8 rounded bg-gray-200"></div>
            </div>
          </div>
        </div>

        <!-- App相关骨架 -->
        <div class="rounded-lg bg-white p-4">
          <div class="mb-4 flex items-center">
            <div class="mr-2 h-4 w-4 rounded bg-gray-200"></div>
            <div class="h-4 w-16 rounded bg-gray-200"></div>
          </div>
          <div class="space-y-2">
            <div class="h-3 w-full rounded bg-gray-200"></div>
            <div class="h-3 w-4/5 rounded bg-gray-200"></div>
            <div class="mt-3 h-8 w-full rounded bg-gray-200"></div>
          </div>
        </div>

        <!-- 打印插件骨架 -->
        <div class="rounded-lg bg-white p-4">
          <div class="mb-4 flex items-center">
            <div class="mr-2 h-4 w-4 rounded bg-gray-200"></div>
            <div class="h-4 w-16 rounded bg-gray-200"></div>
          </div>
          <div class="space-y-2">
            <div class="h-3 w-full rounded bg-gray-200"></div>
            <div class="mt-3 h-8 w-full rounded bg-gray-200"></div>
          </div>
        </div>

        <!-- 系统信息骨架 -->
        <div class="rounded-lg bg-white p-4">
          <div class="mb-4 flex items-center">
            <div class="mr-2 h-4 w-4 rounded bg-gray-200"></div>
            <div class="h-4 w-16 rounded bg-gray-200"></div>
          </div>
          <div class="space-y-2">
            <div v-for="i in 3" :key="i" class="flex justify-between">
              <div class="h-3 w-16 rounded bg-gray-200"></div>
              <div class="h-3 w-12 rounded bg-gray-200"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
</style>
